/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.encapsulation.encapsulationviolation.app;

import java.util.Calendar;
import java.util.Locale;

/**
 *
 * @author given
 */
public class Student {
    private static String name;
    private static String surname;
    private static int yearsOld;

    public static int getYearsOld() {
        return yearsOld;
    }
    
    public static void setName(String aName) {
        name = aName;
    }
    public static void calculateYearsOld(int yearBorn) {
        Calendar cal = Calendar.getInstance(Locale.US);     
        yearsOld =cal.get(Calendar.YEAR)- yearBorn;        
    }

    
    public static void setSurname(String aSurname) {
        surname = aSurname;
    }
    
    @Override
    public String toString() {
        return "Student name: " + name + " \nSurname: " + surname + "\nSthudent age: " + yearsOld;
    }

    public static void setYearsOld(int aYearsOld) {
        yearsOld = aYearsOld;
    }
}